﻿@model myFinance.Models.RegisterModel
@{
	ViewBag.Title = "Registro";
	Layout = null;
}
<link href="@Url.Content("~/Content/SitePublico.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/themes/mytheme/jquery-ui.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.6.4.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/script.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.maskedinput-1.3.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<style type="text/css">
	#page
	{
		text-align: center;
	}
	section
	{
		margin: 40px auto;
		padding: 20px;
		width: 500px;
		background-color: #ffffff;
	}
	fieldset
	{
		margin: 20px auto;
		padding: 0;
		text-align: left;
		width: 500px;
	}
	input[type=submit]
	{
		margin-top: 20px;
		margin-left: 210px;
	}
	.editor-label
	{
		width: 150px;
	}
	.editor-field
	{
		height: 50px;
	}
	.editor-field input[type=text], .editor-field input[type=password]
	{
		width: 300px;
	}
	#DataNascimento
	{
		width: 190px;
	}
</style>
<div id="page">
	<section id="main">
		<h2>
			Cadastro Novo</h2>
		<p>
			A senha deve ter no mínimo @Membership.MinRequiredPasswordLength caracteres.
		</p>
		@using (Html.BeginForm())
  {
			@Html.ValidationSummary(true, "Não foi possível criar o cadastro. Por favor corrija os erros e tente novamente.")
			<div>
				<fieldset>
					<legend></legend>
					<div class="editor-label">
						@Html.LabelFor(m => m.UserName)
					</div>
					<div class="editor-field">
						@Html.TextBoxFor(m => m.UserName, new { @class = "obrigatorio" })
						<br />
						@Html.ValidationMessageFor(m => m.UserName)
					</div>
					<div class="editor-label">
						@Html.LabelFor(m => m.Nome)
					</div>
					<div class="editor-field">
						@Html.TextBoxFor(m => m.Nome, new { @class = "obrigatorio" })
						<br />
						@Html.ValidationMessageFor(m => m.Nome)
					</div>
					<div class="editor-label">
						@Html.LabelFor(m => m.DataNascimento)
					</div>
					<div class="editor-field">
						@Html.TextBoxFor(model => model.DataNascimento, new { maxlength = 10, @class = "obrigatorio datepicker" })
						@Html.RadioButtonFor(model => model.Sexo, false, new { id = "masculino", style = "margin-left: 35px;", @checked = "checked" })
						<label for="masculino">
							<img src="@Url.Content("~/Content/imagens/male.png")" alt="Masculino" />
						</label>
						@Html.RadioButtonFor(model => model.Sexo, true, new { id = "feminino" })
						<label for="feminino">
							<img src="@Url.Content("~/Content/imagens/female.png")" alt="Feminino" /></label>
						<br />
						@Html.ValidationMessageFor(m => m.DataNascimento)
					</div>
					<div class="editor-label">
						@Html.LabelFor(m => m.Email)
					</div>
					<div class="editor-field">
						@Html.TextBoxFor(m => m.Email, new { @class = "obrigatorio" })
						<br />
						@Html.ValidationMessageFor(m => m.Email)
					</div>
					<div class="editor-label">
						@Html.LabelFor(m => m.Password)
					</div>
					<div class="editor-field">
						@Html.PasswordFor(m => m.Password, new { @class = "obrigatorio" })
						<br />
						@Html.ValidationMessageFor(m => m.Password)
					</div>
					<div class="editor-label">
						@Html.LabelFor(m => m.ConfirmPassword)
					</div>
					<div class="editor-field">
						@Html.PasswordFor(m => m.ConfirmPassword, new { @class = "obrigatorio" })
						<br />
						@Html.ValidationMessageFor(m => m.ConfirmPassword)
					</div>
					<p>
						<input type="submit" value="Cadastrar" />
					</p>
				</fieldset>
			</div>
  }
	</section>
	<footer>
		&#169; 2011 - Personal Micro Finance
		</footer>
</div>
<script type="text/javascript">
	$(function () {
		$.validator.methods.dataNascObrigatoria = function (value, element, param) {
			if (validaDataNascimento($(element).val())) {
				return true;
			} else {
				return false;
			}
		};
		$('.datepicker').mask('99/99/9999');
		$('#DataNascimento').rules('add', { dataNascObrigatoria: true, messages: { dataNascObrigatoria: "* Data inválida!"} });
		loadPage();
	});
	$('form').submit(function () {
		var dataNasc = $('#DataNascimento').val();
		if (true) {

		}
	});
</script>
